﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using fanfu.Common;
using fanfu.Business;
using fanfu.Model;

public partial class MainPage : BasePage
{
    //用户所有信息
    public AdminUserModel __AdminUser = new AdminUserModel();

    /// <summary>
    /// 用户状态枚举值转换
    /// </summary>
    public string GetFlagDes(object objFlag)
    {
        string strResult = string.Empty;
        int flag = Convert.ToInt32(objFlag);
        switch (flag)
        {
            case (int)AdminUserFlag.normal: strResult = "正常"; break;
            case (int)AdminUserFlag.locked: strResult = "锁定"; break;
            case (int)AdminUserFlag.delete: strResult = "删除"; break;
        }
        return strResult;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //获取当前登录用户信息并绑定到前台
            string userName = CookieHelper.GetCookie("userName");
            __AdminUser = new AdminUserRule().GetUserInfoByName(userName);
        }
    }
}